home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / TSR / TPPOP18C / NODICE.PAS < prev    next >
Pascal/Delphi Source File  |  1988-11-24  |  1KB  |  39 lines

  1. {$A+,B-,D+,E-,F-,I+,L+,N-,O-,R-,S-,V-}
  2. {$M 1024,5120,5120}
  3. Program RemovePopUpDice;
  4.  
  5. { This is the companion program to POPDICE.  This short program removes }
  6. { the resident program from memory if it is loaded and if it is safe to }
  7. { do so.                                                                }
  8.  
  9. Uses Unhook;
  10.  
  11. Const
  12.   Name = 'POPDICE';
  13.   Signature = $89; { This value MUST be the same as the resident program's }
  14.  
  15. Var
  16.  Result : Integer;
  17.  
  18. Begin
  19.   WriteLn('Attempting to remove ',Name,' from program memory.');
  20.   If Installed(Signature)              { is it installed?    }
  21.     Then Begin                         { yes.                }
  22.       If OkToRemove(Signature)         { can it be unloaded? }
  23.         Then Begin
  24.           RemoveProgram(Signature);    { yes. remove it.     }
  25.           WriteLn(Name,' successfully removed.');
  26.           Result := 0;
  27.         End
  28.       Else Begin
  29.         WriteLn('Unable to remove ',Name,' from memory.');  { unsafe }
  30.         Result := 2;
  31.       End
  32.     End
  33.   Else Begin
  34.     WriteLn(Name,' is not installed.'); { program not found in memory. }
  35.     Result := 1;
  36.   End;
  37.   Halt(Result);
  38. End.
  39.